<template>
  <div class="warp">
    <div class="title-bar">
      <img class="icon" :src="iconDevice" />
      <div class="title">设备类型</div>
    </div>
    <div class="content">
      <div>
        <img class="device-ico" :src="iconSmokeDetector" alt="" />
        <div>
          <span class="num">{{smokeSensorCount}}</span>
          <span class="text">烟感</span>
        </div>
      </div>
      <div>
        <img class="device-ico" :src="iconFireHydrant" alt="" />
        <div>
          <span class="num xfcolor">{{firePressureCount}}</span>
          <span class="text">消防栓</span>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  data () {
    return {
      iconDevice: require('../../assets/images/jialey/icon/device-type.png'),
      iconSmokeDetector: require('../../assets/images/jialey/icon/icon-yangan.png'),
      iconFireHydrant: require('../../assets/images/jialey/icon/icon-xiaofangshuan.png'),
      detail: [],
      smokeSensorCount: 0, // 烟感设备数量
      firePressureCount: 0 // 消防设备数量
    }
  },
  mounted () {
    this.getMainData()
  },
  methods: {
    getMainData () {
      let url = this.$base.getUrl('summaryByDeptId')
      let params = {
        url: url,
        data: {
          'deptId': this.$route.params.deptId
        }
      }

      this.$store.dispatch('postForm', params).then((res) => {
        this.smokeSensorCount = res.result.smokeSensorCount
        this.firePressureCount = res.result.firePressureCount
      })
    }
  }
}
</script>
<style lang="less" scoped>
.warp {
  .title-bar {
    padding-bottom: 10px;
    border-bottom: 1px solid #465775;
    > div {
      display: inline-block;
    }
    .icon {
      vertical-align: text-top;
      margin-right: 10px;
    }
    .title {
      font-size: 16px;
      font-weight: 600;
      color: #fff;
    }
  }
}

.content {
  display: flex;
  justify-content: space-between;
  margin-top: 30px;
  box-sizing: border-box;
  padding: 0 6px;
  > div {
    display: flex;
    .device-ico {
      width: 42px;
      height: 42px;
      margin-right: 12px;
    }
    .num {
      display: block;
      height: 26px;
      font-size: 22px;
      font-weight: 400;
      text-align: left;
      color: #008be8;
      line-height: 26px;
    }
    .xfcolor {
      color: #b7e986;
    }
    .text {
      display: block;
      height: 20px;
      font-size: 14px;
      font-weight: 400;
      text-align: left;
      color: #fff;
      line-height: 20px;
    }
  }
}
</style>
